import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    showLandRight: false,  // 是否显示宗地产权空间，取值false或true
    showBuildingsRight: null,  // 是否显示建筑产权空间，取值null、'产权状态'、'产权类型'，分别对应不显示、按产权状态显示和按产权类型显示
    landRightOpacity: 0.4,
    buildingRightOpacity: 0.5,
    landInfo: null, // 宗地信息
    boundaryPoints: [], // 界址点信息
    buildingOverview: {}, // 存储楼栋的概况信息，例如id、楼层数等，用于请求楼栋属性详情
    buildingInfo: [],  // 存储楼栋的产权详情
    mode: 'global',          // 当前地图的显示模式，分别是'global'代表外立面，'building'表示单栋建筑模式，'floor'表示分层模式
    houseInfo: null,
    activeFloor:0
  },
  mutations: {
    patch_land_right(state, value) {
      state.showLandRight = value
    },
    patch_buldings_right(state, value) {
      state.showBuildingsRight = value
    },
    patch_land_info(state, value) {
      state.landInfo = value
    },
    patch_land_opacity(state, value) {
      state.landRightOpacity = value
    },
    patch_building_opacity(state, value) {
      state.buildingRightOpacity = value
    },
    patch_mode(state, mode) {
      state.mode = mode
    },
    patch_house_info(state, value) {
      state.houseInfo = value
    },
    patch_building_overview(state, value) {
      state.buildingOverview = value
    },
    patch_building_info(state, value) {
      state.buildingInfo = value
    },
    patch_active_floor(state, value) {
      state.activeFloor = value
    }
  },
  actions: {
  },
  modules: {
  }
})
